From: Daniel van Vugt Date: Thu, 20 Feb 2020 08:02:20 +0000 (+0800) Subject: slider: Calculate handle position in whole pixel units X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~772^2^2~75 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=38da479ee8378c17947cbad802aef8f169364590;p=gnome-shell.git slider: Calculate handle position in whole pixel units `-slider-handle-radius` is a floating point value and even in the default theme it's not a whole number. Regardless of the fractional part that's still going to occupy a whole extra pixel with antialiasing. So make room for it. Otherwise it looks clipped, which it is by the Cairo context of its `StDrawingArea`. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1569 --- diff --git a/js/ui/slider.js b/js/ui/slider.js index 824cf8755..01b29e1fc 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -43,7 +43,9 @@ var Slider = GObject.registerClass({ let [hasHandleColor, handleBorderColor] = themeNode.lookup_color('-slider-handle-border-color', false); - let handleX = handleRadius + (width - 2 * handleRadius) * this._value / this._maxValue; + let wholeHandleRadius = Math.ceil(handleRadius); + let handleX = wholeHandleRadius + + (width - 2 * wholeHandleRadius) * this._value / this._maxValue; let handleY = height / 2; let color = themeNode.get_foreground_color();